//
//  YKBaseNavController.m
//  YingKe
//
//  Created by 崔博 on 16/11/19.
//  Copyright © 2016年 崔博. All rights reserved.
//

#import "YKBaseNavController.h"

@interface YKBaseNavController ()

@end

@implementation YKBaseNavController

// 保证只对nacvar进行一次设置
+ (void)initialize
{
    UINavigationBar *navBar = [UINavigationBar appearance];
    [navBar setBackgroundImage:[UIImage imageNamed:@"nav_backImage"] forBarMetrics:UIBarMetricsDefault];
    // 设置字号
    [navBar setTitleTextAttributes:@{
                                     NSForegroundColorAttributeName:[UIColor blackColor],
                                     NSFontAttributeName:[UIFont boldSystemFontOfSize:20.f]
                                     }];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.count) {
    viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barItem:@"详情界面返回按钮" title:@"" target:self action:@selector(pop)];
    }
    [super pushViewController:viewController animated:animated];
}

- (void)pop
{
    [self popViewControllerAnimated:YES];
}


@end
